<?php


/** ensure this file is being included by a parent file */
defined( '_JEXEC' ) or die( 'Direct Access to this location is not allowed.' );

/**
 * @package	
 */
class HelpDeskUrl 
{
	/**
	 * 
	 * @return unknown_type
	 */
	function root()
	{
		$return = JURI_BASE;
		return $return;	
	}
	
	/**
	 * 
	 * @return unknown_type
	 */
	function base()
	{
		$return = JURI_BASE;
		return $return;
	}
	
	/**
	 * Wrapper that adds the current Itemid to the URL
	 *
	 * @param	string $string The string to translate
	 *
	 */
	function &addItemid( $url ) 
	{
		global $Itemid;
		$item_id = HelpDeskRequest::getVar( 'Itemid', $Itemid );
		$return = $url;
		
		if ($item_id)
		{
			$return.= "&Itemid=".$item_id;	
		}
		
		return $return;
	}
	
	/**
	 * Wrapper that adds the current Itemid to the URL
	 *
	 * @param	string $string The string to translate
	 *
	 */
	function &popup( $url, $text, $width=640, $height=480, $top=0, $left=0, $class='' ) 
	{
		$html = "";
		// JHTML::_('behavior.modal');		
		$doTask	= $url;

		$html	= "<a class=\"modal\" href=\"$doTask\" rel=\"{handler: 'iframe', size: {x: $width, y: $height}}\">\n";
		$html 	.= "<span class=\"$class\" title=\"$text\">\n";
		$html 	.= "</span>\n";
		$html	.= "$text\n";
		$html	.= "</a>\n";
		
		return $html;
	}
}